package beans.basic;

import java.net.InetAddress;

/**
 * Created by Stimd
 * 项目地址：https://gitee.com/stimd/spring-wheel
 * 公众号：Java编程探微
 */
public class ServerProperties {
    private Integer port;
    private String contextPath = "/";
    private InetAddress address;
    private Tomcat tomcat;

    public Integer getPort() {
        return port;
    }

    public void setPort(Integer port) {
        this.port = port;
    }

    public String getContextPath() {
        return contextPath;
    }

    public void setContextPath(String contextPath) {
        this.contextPath = contextPath;
    }

    public InetAddress getAddress() {
        return address;
    }

    public void setAddress(InetAddress address) {
        this.address = address;
    }

    public Tomcat getTomcat() {
        return tomcat;
    }

    public void setTomcat(Tomcat tomcat) {
        this.tomcat = tomcat;
    }

    public static class Tomcat{
        private int maxThreads = 200;   //最大工作线程
        private int maxConnections = 10000;
        private int acceptCount = 100;

        public int getMaxThreads() {
            return maxThreads;
        }

        public void setMaxThreads(int maxThreads) {
            this.maxThreads = maxThreads;
        }

        public int getMaxConnections() {
            return maxConnections;
        }

        public void setMaxConnections(int maxConnections) {
            this.maxConnections = maxConnections;
        }

        public int getAcceptCount() {
            return acceptCount;
        }

        public void setAcceptCount(int acceptCount) {
            this.acceptCount = acceptCount;
        }

        @Override
        public String toString() {
            return "Tomcat{" +
                    "maxThreads=" + maxThreads +
                    ", maxConnections=" + maxConnections +
                    ", acceptCount=" + acceptCount +
                    '}';
        }
    }

    @Override
    public String toString() {
        return "ServerProperties{" +
                "port=" + port +
                ", contextPath=" + contextPath +
                ", address=" + address +
                ", tomcat=" + tomcat +
                '}';
    }
}
